using GroupSix.Domain.Entity;

namespace GroupSix.Domain.Entity.App;

/// <summary>
/// 操作日志实体
/// </summary>
public class GsOperationLog : EntityBase
{
    /// <summary>
    /// 操作人ID
    /// </summary>
    public Guid OperatorId { get; set; }

    /// <summary>
    /// 操作人用户名
    /// </summary>
    public string OperatorName { get; set; } = string.Empty;

    /// <summary>
    /// 操作类型 (login, logout, create, update, delete, query, etc.)
    /// </summary>
    public string OperationType { get; set; } = string.Empty;

    /// <summary>
    /// 操作模块 (user, role, menu, systemsetting, etc.)
    /// </summary>
    public string Module { get; set; } = string.Empty;

    /// <summary>
    /// 操作描述
    /// </summary>
    public string Description { get; set; } = string.Empty;

    /// <summary>
    /// 操作详情 (JSON格式)
    /// </summary>
    public string Details { get; set; } = string.Empty;

    /// <summary>
    /// 操作结果 (success, failed)
    /// </summary>
    public string Result { get; set; } = "success";

    /// <summary>
    /// 错误信息 (如果操作失败)
    /// </summary>
    public string ErrorMessage { get; set; } = string.Empty;

    /// <summary>
    /// IP地址
    /// </summary>
    public string IpAddress { get; set; } = string.Empty;

    /// <summary>
    /// 用户代理
    /// </summary>
    public string UserAgent { get; set; } = string.Empty;

    /// <summary>
    /// 请求URL
    /// </summary>
    public string RequestUrl { get; set; } = string.Empty;

    /// <summary>
    /// 请求方法 (GET, POST, PUT, DELETE)
    /// </summary>
    public string RequestMethod { get; set; } = string.Empty;

    /// <summary>
    /// 请求参数
    /// </summary>
    public string RequestParams { get; set; } = string.Empty;

    /// <summary>
    /// 响应状态码
    /// </summary>
    public int ResponseStatusCode { get; set; }

    /// <summary>
    /// 执行时间 (毫秒)
    /// </summary>
    public long ExecutionTime { get; set; }

    /// <summary>
    /// 操作时间
    /// </summary>
    public DateTime OperationTime { get; set; } = DateTime.UtcNow;
} 